package com.sunlands.qdcy.deskmate.dao.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity(name = "payment_alipay_notify_record")
@JsonSerialize
@DynamicUpdate
@DynamicInsert
public class PaymentAliPayNotifyRecordDO implements Serializable {
    private static final long serialVersionUID = 5246377421019672167L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 商户唯一订单号
     */
    private String outTradeNo;
    /**
     * 支付宝交易号
     */
    private String tradeNo;
    /**
     * 订单总金额，单位元
     */
    private BigDecimal totalAmount;
    /**
     * 商品描述
     */
    private String body;
    /**
     * 商品标题
     */
    private String subject;

    private String appId;
    /**
     * 商户回调地址
     */
    private String notifyUrl;
    /**
     * 通知类型
     */
    private String notifyType;
    /**
     * 通知校验ID
     */
    private String notifyId;
    /**
     * 商户业务ID，主要是退款通知中返回退款申请的流水号
     */
    private String outBizNo;
    /**
     * 买家支付宝用户号，2088开头
     */
    private String buyerId;
    /**
     * 买家支付宝账号
     */
    private String buyerLogonId;
    /**
     * 卖家支付宝用户号
     */
    private String sellerId;
    /**
     * 卖家支付宝账号
     */
    private String sellerMail;
    /**
     * 交易状态
     */
    private String tradeStatus;
    /**
     * 实收金额
     */
    private Double receiptAmount;
    /**
     * 开票金额
     */
    private Double invoiceAmount;
    /**
     * 总退款金额
     */
    private Double refundFee;
    /**
     * 交易创建时间
     */
    private Date gmtCreate;
    /**
     * 交易付款时间
     */
    private Date gmtPayment;
    /**
     * 交易结束时间
     */
    private Date gmtClose;
    /**
     * 支付金额信息（各个渠道金额信息）
     */
    private String fundBillList;
    @CreationTimestamp
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    @UpdateTimestamp
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;
    /**
     * 验证结果
     */
    private boolean signVerified;

    private boolean firstChangeToPayed;


}